
import { BaseModel, sequelize, Sequelize } from "./basemodel.js";

class SmartContractTransactions extends BaseModel {
	static init() {
		return super.init(
			{
				
				contract_transactions_id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true },
				transaction_hash: { type:Sequelize.STRING  ,defaultValue: Sequelize.literal('DEFAULT') },
				block_number: { type:Sequelize.STRING  ,defaultValue: Sequelize.literal('DEFAULT') },
				timestamp: { type:Sequelize.STRING  ,defaultValue: Sequelize.literal('DEFAULT') },
				block_hash: { type:Sequelize.STRING  ,defaultValue: Sequelize.literal('DEFAULT') }
			}, 
			{ 
				sequelize,
				
				tableName: "smart_contract_transactions",
				modelName: "smart_contract_transactions",
			}
		);
	}
	
	static listFields() {
		return [
			'contract_transactions_id', 
			'transaction_hash', 
			'block_number', 
			'timestamp', 
			'block_hash'
		];
	}

	static viewFields() {
		return [
			'contract_transactions_id', 
			'transaction_hash', 
			'block_number', 
			'timestamp', 
			'block_hash'
		];
	}

	static editFields() {
		return [
			'contract_transactions_id', 
			'transaction_hash', 
			'block_number', 
			'timestamp', 
			'block_hash'
		];
	}

	
	static searchFields(){
		return [
			Sequelize.literal("contract_transactions_id LIKE :search"), 
			Sequelize.literal("transaction_hash LIKE :search"), 
			Sequelize.literal("block_hash LIKE :search"),
		];
	}

	
	
}
SmartContractTransactions.init();
export default SmartContractTransactions;
